package server.mapping;

import lombok.Builder;
import lombok.Data;
import server.HttpServlet;
import server.classloader.WebappClassLoader;

import java.util.HashMap;
import java.util.Map;


/**
 * 此处不再封装Wrapper, 同时以path (即context-path)作为map的key
 */
@Data
@Builder
public class Context {
    /**
     * Context相关属性  /demo1
     */
    private String docBase;
    private String path;

    /**
     * http://localhost:8080/demo1/lagou1
     * http://localhost:8080/demo1/lagou2
     *
     *
     *
     *
     * /demo1 -> WebappClassLoader  各自web应用的类加载器
     */
    private WebappClassLoader webappClassLoader;
    /**
     * /lagou1 -> HttpServlet  web应用的servlet
     * /lagou2 -> HttpServlet  web应用的servlet
     */
    private Map<String, HttpServlet> servletMap = new HashMap<>();
}
